import Vue from 'vue'
import 'core-js'
import router from './router/index.js'
import SvgIcon from './components/SvgIcon.vue'


import App from './App.vue'
import ElementUI from 'element-ui';

import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
import store from './store/'
import EllipsisCom from './components/Ellipsis.vue'
import '@/utils/decimal.js'
import '@/utils/Auth.js'
 import {INVOICERECEIVE} from "@/components/common/constant.js";

Number.prototype.toFixedCustom = function(decimalPlaces) {
  // 判断传入的参数是否是数字
  if (isNaN(decimalPlaces)) {
      throw new RangeError("toFixedCustom() digits argument must be between 0 and 20");
  }

  // 对数字进行四舍五入
  var roundedNumber = Math.round(this * Math.pow(10, decimalPlaces)) / Math.pow(10, decimalPlaces);

  // 转换成字符串
  var roundedString = roundedNumber.toFixed(decimalPlaces);
  return roundedString;
};
String.prototype.toFixedCustom = function(decimalPlaces) {
  Vue.prototype.bigNumFixed(this,decimalPlaces)
};

 String.prototype.toFixed = function(len) {
  Vue.prototype.bigNumFixed(this,len)
};



import './style/reset.scss'
import {DictCode} from "@/utils/DictConstant";
import twoLevelDialog from '@/components/twoLevelDialog.vue'

Vue.component('twoLevelDialog', twoLevelDialog);
Vue.component('svg-icon', SvgIcon);
Vue.prototype.$deepCopy = function (obj){return JSON.parse(JSON.stringify(obj))}
Vue.prototype.$XModal = VXETable.modal

Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.use(VXETable)
Vue.use(EllipsisCom);
Vue.prototype.INVOICERECEIVE = INVOICERECEIVE;



new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
